package com.ruoyi.chat.mq.consumer;

import com.ruoyi.chat.config.RabbitConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MQTestController {
    @Resource
    private RabbitTemplate rabbitTemplate;
    @Resource
    private RabbitConfig rabbitConfig;
    @GetMapping("/mq/test")
    public void test(){
        rabbitTemplate.convertAndSend(rabbitConfig.chatExchange,rabbitConfig.chatAckTopic,"ack");
    }
}
